<style>
#komitent_materijal_result{
	margin-top:2px;
}
#komitent_materijal_result ul.letter_filter{
	margin:10px 0px;
}
#komitent_materijal_result ul.letter_filter li strong{
	width:auto;
}
#komitent_materijal_result table tr td{
	vertical-align:top;
}
#komitent_materijal_result table tr td input[type=button]{
	background-color:transparent;
	background-position:center center;
	width:16px;
	height:16px;
	overflow:hidden;
	padding:0px;
	border:none;
	cursor:pointer;
}
</style>
<div id="komitent_materijal">
	<form class="area" method="post" action="javascript:void(0)" onSubmit="submitForm(this,'komitenti.php','POST','setContent',1)">
		<input type="hidden" name="a" value="materijal" />
		
		<a style="float:right" href="javascript:void(0)" onclick="LoadRSDoc('komitenti.php?a=materijal&mod=new','setContent')">
			<img src="gui/icons/new.gif" align="absmiddle" border="0" /> novi
		</a>
		<h1>Pregled poslatih materijala</h1>
		
		<fieldset>
			<legend>Filter</legend>
			
			<div style="float:left">
				<label class="left" for="f_radnik">Radnik:</label>
				<select name="f_radnik" id="f_radnik">
					<option value="-1">---</option>
					{{%loop start radnik_id}}
					<option value="{{$radnik_id}}" {{$radnik_selected}}>{{$radnik_ime}}&nbsp;{{$radnik_prezime}}</option>
					{{%loop end}}
				</select>
				<br clear="all" />
				<label class="left" for="f_ugovor">Ugovor:</label>
				<input type="text" name="f_ugovor" id="f_ugovor" value="{{$f_ugovor}}" />
				<br clear="all" />
				<label class="left" for="f_komitent">Komitent:</label>
				<input type="text" name="f_komitent" id="f_komitent" value="{{$f_komitent}}" />
			</div>
			<fieldset style="float:left;">
				<legend>Datum slanja</legend>
				<label class="left" for="f_date_start">Od:</label>
				<input type="text" name="f_date_start" id="f_date_start" value="{{$f_date_start}}" class="dateInput" />
				<input type="button" class="datePicker" onClick="displayDatePicker('f_date_start',this)" />
				<br clear="all" />
				<label class="left" for="f_date_end">Do:</label>
				<input type="text" name="f_date_end" id="f_date_end" value="{{$f_date_end}}" class="dateInput" />
				<input type="button" class="datePicker" onClick="displayDatePicker('f_date_end',this)" />
			</fieldset>
			<fieldset style="float:left">
				<legend>ishod</legend>
				<select name="f_ishod" id="f_ishod">
					<option value="-1">---</option>
					{{%loop start ishod_id}}
					<option value="{{$ishod_id}}" {{$ishod_selected}}>{{$ishod_name}}</option>
					{{%loop end}}
				</select>
				<br clear="all" />
				<label class="left" for="f_ishod_time_start">Od:</label>
				<input type="text" name="f_ishod_time_start" id="f_ishod_time_start" value="{{$f_ishod_time_start}}" class="dateInput" />
				<input type="button" class="datePicker" onClick="displayDatePicker('f_ishod_time_start',this)" />
				<br clear="all" />
				<label class="left" for="f_ishod_time_end">Do:</label>
				<input type="text" name="f_ishod_time_end" id="f_ishod_time_end" value="{{$f_ishod_time_end}}" class="dateInput" />
				<input type="button" class="datePicker" onClick="displayDatePicker('f_ishod_time_end',this)" />
			</fieldset>
			
			<br clear="all" />			
			<input type="submit" value="filter" />
		</fieldset>
	</form><br clear="all" />
	<div class="area_white" id="komitent_materijal_result">
		{{$comment_start}}
		<ul class="letter_filter" filterquery="{{$filter_query}}">
			<li><strong>Strana:</strong></li>
			{{%loop start page}}
			<li><a href="javascript:void(0)" onclick="PageFilter(this,'komitenti.php',{{$page}})" id="{{$page_current}}">{{$page}}</a></li>
			{{%loop end}}
		</ul><br clear="all" />
		<table>
			<tr class="head" align="center">
				<td>radnik/korisnik</td>
				<td>ugovor</td>
				<td>komitent</td>
				<td>tip slanja</td>
				<td>datum</td>
				<td colspan="2">ishod</td>
				<td>opis</td>
				<td></td>
			</tr>
			{{%loop start id}}
			<tr>
				<td title="korisnik:&nbsp;{{$username}}">{{$radnik}}</td>
				<td title="šifra ugovora:&nbsp;{{$ugovorid}}">
					<a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'ugovori.php?a=display&id={{$ugovorid}}\',\'setContent\')')">
						{{$ugovor}}
					</a>
				</td>
				<td>
					<a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'komitenti.php?a=displayOne&id={{$komitent_id}}\',\'setContent\')')">
						{{$komitent_id}}.&nbsp;{{$komitent_name}}
					</a>
				</td>
				<td>{{$tip_slanja}}</td>
				<td>{{$datum}}</td>
				<td>{{$ishod}}</td>
				<td>{{$ishod_time}}</td>
				<td>{{$opis}}</td>
				<td>
					<input title="delete" type="button" class="delete" onclick="if(confirm('Potvrdite brisanje?')){LoadRSDoc('komitenti.php?a=materijal&mod=delete&id={{$id}}','afterKomitentMaterijalDelete')}" />
				</td>
			</tr>
			{{%loop end}}
		</table>
		{{$comment_end}}
	</div>
</div>